﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UsersMaster.master" AutoEventWireup="true"
    CodeBehind="OrderDetails.aspx.cs" Inherits="SMS.Orders.OrderDetails" %>

<asp:Content ID="Content1" ContentPlaceHolderID="UserHeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="UserMainContent" runat="server">
    <div class="boxed" dir="rtl">
        <h2 class="title">
            فـاتورة</h2>
        <div class="content" dir="rtl">
            <table>
                <tr>
                    <td>
                        <asp:Label runat="server" Text="رقـم الفـاتورة:" />
                    </td>
                    <td>
                        <asp:Label ID="lblID" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label runat="server" Text="التـاريخ :" />
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtDate" />
                        <ajax:CalendarExtender runat="server" TargetControlID="txtDate" ID="clndrExtndrDate" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label runat="server" Text="أسم العمـيل :" />
                    </td>
                    <td>
                        <asp:Label runat="server" ID="lblCustomerName" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label runat="server" Text="نـوع الفاتـورة:" />
                    </td>
                    <td>
                        <asp:Label runat="server" ID="lblType" />
                    </td>
                </tr>
            </table>
            <asp:DataList ID="dlOrderItems" runat="server" DataKeyField="ID" 
                HeaderStyle-Font-Bold="true" oneditcommand="dlOrderItems_EditCommand" 
                onitemdatabound="dlOrderItems_ItemDataBound" 
                oncancelcommand="dlOrderItems_CancelCommand">
                <HeaderTemplate>
                    <table border="1" width="100%">
                        <tr align="center">
                            <td>
                                <asp:Label runat="server" Text="Part Number" Font-Bold="true" />
                            </td>
                            <td>
                                <asp:Label runat="server" Text="أسـم المنـتـج" Font-Bold="true" />
                            </td>
                            <td>
                                <asp:Label runat="server" Text="المــاركـة" Font-Bold="true" />
                            </td>
                            <td>
                                <asp:Label runat="server" Text="العدد في المخـزن" Font-Bold="true" />
                            </td>
                            <td>
                                <asp:Label runat="server" Text="الكـمـيـة" Font-Bold="true" />
                            </td>
                            <td>
                                <asp:Label runat="server" Text="سـعـر الوحـدة" Font-Bold="true" />
                            </td>
                            <td>
                                <asp:Label runat="server" Text="الاجمــالي" Font-Bold="true" />
                            </td>
                            <td>
                                <asp:Label runat="server" Text="حـذف" Font-Bold="true" />
                            </td>
                            <td>
                                <asp:Label runat="server" Text="تعـديـل" Font-Bold="true" />
                            </td>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr align="center">
                        <td>
                            <asp:Label runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"StockItem.Item.PartNumber") %>' />
                        </td>
                        <td>
                            <asp:Label runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"StockItem.Item.Name") %>' />
                        </td>
                        <td>
                            <asp:Label runat="server" Text='<%# DataBinder.Eval(Container,"DataItem.StockItem.Item.Mark") %>' />
                        </td>
                        <td>
                            <asp:Label runat="server" Text='<%# DataBinder.Eval(Container,"DataItem.StockItem.Count") %>' />
                        </td>
                        <td>
                            <asp:Label runat="server" Text='<%#DataBinder.Eval(Container,"DataItem.ItemCount") %>'
                                ID="lblQuantity" />
                        </td>
                        <td>
                            <asp:Label runat="server" ID="lblSellingPrice" Text='<%# DataBinder.Eval(Container,"DataItem.UnitPrice") %>' />
                        </td>
                        <td>
                            <asp:Label runat="server" ID="lblItemTotal" />
                        </td>
                        <td>
                            <asp:LinkButton runat="server" CommandName="delete" Text="حـذف" ID="lbDelete" OnClientClick="return confirm('سـوف يتـم حـذف البيــان من الفـاتــورة')" />
                        </td>
                        <td>
                            <asp:LinkButton runat="server" CommandName="edit" Text="تعـديـل" ID="lbEdite" />
                        </td>
                    </tr>
                </ItemTemplate>
                <EditItemTemplate>
                    <tr align="center">
                        <td>
                            <asp:Label runat="server" Text='<%# DataBinder.Eval(Container,"DataItem.StockItem.Item.Name") %>' />
                        </td>
                        <td>
                            <asp:Label runat="server" Text='<%# DataBinder.Eval(Container,"DataItem.StockItem.Item.Name") %>' />
                        </td>
                        <td>
                            <asp:Label runat="server" Text='<%# DataBinder.Eval(Container,"DataItem.StockItem.Item.Mark") %>' />
                        </td>
                        <td>
                            <asp:Label runat="server" Text='<%#DataBinder.Eval(Container,"DataItem.StockItem.Count") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="txtQuantity" runat="server" Text='<%#DataBinder.Eval(Container,"DataItem.ItemCount") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="txtSellingPrice" runat="server" Text='<%# DataBinder.Eval(Container,"DataItem.UnitPrice") %>' />
                        </td>
                        <td>
                        </td>
                        <td>
                            <asp:LinkButton runat="server" Text="مـوافق" CommandName="update" />
                        </td>
                        <td>
                            <asp:LinkButton runat="server" Text="الغـاء" CommandName="cancel" />
                        </td>
                    </tr>
                </EditItemTemplate>
                <FooterTemplate>
                    <tr align="center">
                        <td>
                            <asp:Label runat="server" Text="أجــمالي الفـاتـورة" Font-Bold="true" />
                        </td>
                        <td>
                            <asp:Label runat="server" Font-Bold="true" ID="lblTotalPrice"/>
                        </td>
                        <td>
                            <asp:Label runat="server" Text="المـدفــوع" Font-Bold="true" />
                        </td>
                        <td>
                            <asp:Label runat="server" Font-Bold="true" ID="lblPaid" />
                        </td>
                    </tr>
                    </table>
                </FooterTemplate>
            </asp:DataList>
        </div>
    </div>
</asp:Content>